package week01.day03;

/*
    算术运算符：+ - * / %
 */

public class 算术运算符 {
    public static void main(String[] args) {
        /*
        1、单独使用时，前置递增和后置递增都是在自身的基础上+1；
        2、需要赋值时，前置递增，先增后赋值；后置递增，先赋值后递增；
         */
        int x = 4;
        x++;//x=x+1;
        System.out.println(x);
        ++x;//x=x+1;
        System.out.println(x);

        int y = 5;
        int a,b;
        a = y++;//a = y;y=y+1
        System.out.println(a);//a = 5,y = 5;
        b = ++y;//y = y+1; b = y;
        System.out.println(b);
    }
}
